Fix use-after-read that I just introduced in gpx.cc
authorrobertlipe <robertlipe@gmail.com>
Sun, 25 Aug 2013 20:53:40 +0000 (20:53 +0000)
committerrobertlipe <robertlipe@gmail.com>
Sun, 25 Aug 2013 20:53:40 +0000 (20:53 +0000)
gpsbabel/gpx.cc

index dc2689dab02fc77b659225f9cfa5b1624e773aad..852504dddfd4e455fa3ecfdaf2090f8a82f58ed8 100644 (file)
@@ -1137,8 +1137,7 @@ gpx_end(const QString& el)
     // FIXME: this code seems to rely on atoi() parsing 3d and 2d as 3 and 2
     // which toInt() doesn't do.
     //wpt_tmp->fix = (fix_type)(cdatastr.toInt() - 1);
-    const char *t = CSTR(cdatastr);
-    wpt_tmp->fix = (fix_type)(atoi(t) - 1);
+    wpt_tmp->fix = (fix_type)(atoi(CSTR(cdatastr)) - 1);
     }
     if (wpt_tmp->fix < fix_2d) {
       if ((cdatastr.compare("none"), Qt::CaseInsensitive) == 0) {